#2802 closed enhancement (fixed)
[raster] ST_MapAlgebra checks callbacks parameters but not return type
Reported by: | strk | Owned by: | dustymugs |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.4 |
Component: | raster | Version: | 2.1.x |
Keywords: | history | Cc: |
Description
I tried using a callback only accepting 2 arguments and ST_MapAlgebra complained about that. But it did not complain about the callback returning an integer rather than a float8.
As the C code fetches the return value in binary form, I guess returning anything but "float8" would just not work, silently.
If this is confirmed, it would be nice for ST_MapAlgebra to also check the return type of the provided callback.
Change History (6)
comment:1 by , 10 years ago
Status: | new → assigned |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
I didnt' get an exception when returning integer. Looking at the code the return type check only prevents your callback from returning a SET.
comment:5 by , 10 years ago
Keywords: | history added |
---|---|
Milestone: | → PostGIS 2.1.4 |
Resolution: | → fixed |
Status: | assigned → closed |
Version: | trunk → 2.1.x |
comment:6 by , 10 years ago
Great, thanks!
nitpicking: the error printed on returning a SET still says you need to return a "double precision", while if you return a "text" (for example) the error tells you that also int,smallint and float4 are accepted.
The check for return type will throw an Exception if not a double precision.